package com.pet.shop.entity.option;

import java.util.Date;

public class DataOptionVal {
    private Long id;
    private Long userId;
    private Long dataOptionId;
    private String value1;
    private String value2;
    private Date createTime;
    private Long creatorId;
    private Date modifyTime;
    private Long modifierId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDataOptionId() {
        return dataOptionId;
    }

    public void setDataOptionId(Long dataOptionId) {
        this.dataOptionId = dataOptionId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getValue(){
        if(this.value1 == null && this.value2 == null) return null;
        if(this.value1 == null) return this.value2;
        if(this.value2 == null) return this.value1;
        return this.value1 + this.value2;
    }

    public void setValue(String value){
        if(value == null || value.length() <= 255){
            this.value1 = value;
            this.value2 = null;
            return;
        }
        this.value1 = value.substring(0, 255);
        this.value2 = value.substring(255, value.length());
    }

    public String getValue1() {
        return value1;
    }

    public void setValue1(String value1) {
        this.value1 = value1 == null ? null : value1.trim();
    }

    public String getValue2() {
        return value2;
    }

    public void setValue2(String value2) {
        this.value2 = value2 == null ? null : value2.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Long creatorId) {
        this.creatorId = creatorId;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Long getModifierId() {
        return modifierId;
    }

    public void setModifierId(Long modifierId) {
        this.modifierId = modifierId;
    }
}